Create new endpoint to save style editor schema per content type#36070
Create new endpoint to save style editor schema per content type#36070dario-daza wants to merge 21 commits into
Conversation
|
Claude finished @dario-daza's task in 2m 32s —— View job Rollback Safety Analysis
Pull Request Unsafe to Rollback!!!
|
…or-schema-per-content-type
|
Pull Request Unsafe to Rollback!!!
|
…or-schema-per-content-type
…or-schema-per-content-type
❌ Codex Review failed —
|
The way we handled it in the frontend, it never happens, but it is possible that any REST API caller (Postman, a migration script, or a third-party integration) that makes a raw PUT and omits metadata from the body would silently wipe the schema. I added a validation that prevents this and preserves the metadata if a user omits it in a PUT request. If you want to wipe the metadata, you'll need to send metadata: null. |
…or-schema-per-content-type
…or-schema-per-content-type
🤖 Bedrock Review —
|
…or-schema-per-content-type
Legal RiskThe following dependencies were released under a license that RecommendationWhile merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue. GPL-2.0 MPL-2.0
|
| final ContentType saved = contentTypeHelper.mergeAndSaveMetadata(idOrVar, metadataPatch, contentTypeAPI); | ||
| return Response.ok(new ResponseEntityContentTypeDetailView( | ||
| new HashMap<>(contentTypeHelper.contentTypeToMap(saved, user)))).build(); | ||
| } catch (final NotFoundInDbException e) { |
There was a problem hiding this comment.
Can we use ResponseUtil.mapExceptionResponse(e) with a single catch block instead of the different blocks we have right now? That util method delagates all the responses creation
There was a problem hiding this comment.
I used ErrorEntity to return responses with errorCode and fieldName to make it easier to read the cause, use mapExceptionResponse would reply plain message strings. Happy to simplify if those fields aren't consumed, but keeping them for now to preserve the API contract
…or-schema-per-content-type
…or-schema-per-content-type
Proposed Changes
Create the new
PATCH /v1/contenttype/id/{idOrVar}/metadataendpoint to avoid editing other Content Type information when creating and saving a Style Editor Schema for a Content Type.BE
PATCH /v1/contenttype/id/{idOrVar}/metadataendpoint to handle the metadata of the Content Types, specifically theDOT_STYLE_EDITOR_SCHEMAthat is related to the Style Editor Schema.FE
DotCrudServicewithhttp.This PR fixes: #35781
This PR fixes: #35979